package org.ielts.domain.log;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.ForeignKey;
import org.ielts.domain.LearnStatus;
import org.ielts.domain.base.Course;
import org.ielts.domain.base.SignCourse;
import org.ielts.domain.security.User;

@Entity
@DiscriminatorValue("SignCourse")
public class SignCourseLog extends SchoolLog {

	public SignCourseLog() {
		setLogType("SignCourse");
	}

	@Override
	public String getLogType() {
		return "SignCourse";
	}

	@ManyToOne(cascade = { CascadeType.ALL }, optional = true, fetch = FetchType.LAZY)
	private SignCourse signCourse;

	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	private User checker;

	@ManyToOne(fetch = FetchType.EAGER, optional = true)
	private User consultant;

	@ManyToOne(fetch = FetchType.EAGER, optional = true)
	private Course course;

	private String cardId;
	private String contractId;
	private String lessonCard;
	private String term;
	private Date beginTime;

	private int times;
	private Date endTime;

	private boolean checked;

	private String book;

	@Column(length = 300)
	private String note;

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public String getCardId() {
		return cardId;
	}

	public void setCardId(String cardId) {
		this.cardId = cardId;
	}

	public int getTimes() {
		return times;
	}

	public void setTimes(int times) {
		this.times = times;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getContractId() {
		return contractId;
	}

	public void setContractId(String contractId) {
		this.contractId = contractId;
	}

	public String getTerm() {
		return term;
	}

	public void setTerm(String term) {
		this.term = term;
	}

	public Date getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}

	public String getLessonCard() {
		return lessonCard;
	}

	public void setLessonCard(String lessonCard) {
		this.lessonCard = lessonCard;
	}

	public User getConsultant() {
		return consultant;
	}

	public void setConsultant(User consultant) {
		this.consultant = consultant;
	}

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	public User getChecker() {
		return checker;
	}

	public void setChecker(User checker) {
		this.checker = checker;
	}

	public String getBook() {
		return book;
	}

	public void setBook(String book) {
		this.book = book;
	}

	public SignCourse getSignCourse() {
		return signCourse;
	}

	public void setSignCourse(SignCourse signCourse) {
		this.signCourse = signCourse;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}
}
